package com.ftqh.tutorial.controller;

import lombok.extern.java.Log;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by Administrator on 2017/6/9.
 */
@RestController
@Log
public class TraceController {

    private RestTemplate restTemplate;
    TraceController(RestTemplate restTemplate){
        this.restTemplate = restTemplate;
    }
    @GetMapping("/trace-1")
    public String trace(){
        log.info("##### Call trace-1 #####");
        return restTemplate.getForEntity("http://spring-cloud-sleuth-trace-2/trace-2",String.class).getBody();
    }
}
